home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SoundMaker 2003 (Professional Edition)
/
SoundMaker 2003 - Professional Edition.iso
/
midi tool
/
midioxse.exe
/
DATA.1
/
arrayx.CLS
< prev
next >
Wrap
Text File
|
1999-03-27
|
3KB
|
95 lines
/****************************************************************************/
/* Name: ArrayX */
/* Type: Object REXX Class Definition */
/* Author: Jamie O'Connell */
/* Resource: */
/* */
/* Description: Extended Array Class */
/* */
/* Public Classes: */
/* */
/* Public Routines: */
/* */
/* */
/* Coypright (C) Jamie O'Connell, 1998. All Rights Reserved. */
/* */
/****************************************************************************/
/* ::requires ".CLS" */ /* uncomment if you require another file */
/*-------------------------- Class /**/ -----------------------------------*/
::class ArrayX subclass Array public
/* class attributes */
::method INIT /* constructor */
forward class(super) continue /* call parent constructor */
return
/* ------------------------------------------------------------- */
/* class methods */
::method Remove
use Arg n
self~Remove:super( n )
if self~Last = .NIL then /* empty array */
return
do ii = n to self~Last
self~Put( self~At( ii + 1 ), ii )
end
return
/* ------------------------------------------------------------- */
/* this adds an object to the end */
::method Add
use Arg obj
self~Put( obj, self~HiBound() + 1 )
return
/* ------------------------------------------------------------- */
/* this does a real insert *before* this index supplied */
::method Insert
use Arg obj, n
do ii = self~HiBound() to n by -1
self~Put( self~At( ii ), ii + 1 )
end
self~Put( obj, n )
return
/* ------------------------------------------------------------- */
/* We don't seem to be able to control or influence Items and */
/* First or Last. This provides a counter workaround (expensive) */
::method HiBound
do ii = 1 by 1
if self~At( ii ) = .NIL then
return ii - 1
end
return
/* ------------------------------------------------------------- */
/* Simple indicator of empty or not */
::method IsEmpty
do ii = 1 to self~Items
if self~At( ii ) <> .NIL then
return .FALSE
end
return .TRUE